/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface MaintenanceTaskProcess extends BasicModel<MaintenanceTaskProcess> {
  maintenanceTaskId?: number; // 维保任务ID
  assignerId?: string; // 分配人ID
  assignerName?: string; // 分配人姓名
  enterpriseCode?: string; // 所属企业编码
  enterpriseName?: string; // 所属企业名称
  name?: string; // 工单名称
  address?: string; // 地点
  abnormalPic?: string; // 异常图片URL
  remark?: string; // 隐患描述
  resultPicUrl?: string; // 处理结果图片URL
  resultPicId?: string; // 处理结果图片ID
  reportTime?: string; // 上报时间
  regionId?: number; // 区域ID
  regionName?: string; // 区域名称
  handlingMethod?: string; // 处理方式
  purchaseMethod?: string; // 购买方式
  isOverdue?: string; // 是否存在超期（TRUE: 是, FALSE: 否）
  overdueMessage?: string; // 超期提示内容
  isCurrentStageOverdue?: string; // 当前环节是否超期（TRUE: 是, FALSE: 否）
  currentStageExtensionDuration?: string; // 当前环节延期时间
  createTime?: string; // 创建时间
  supervisorCode?: string; // 监督员编码
  supervisorName?: string; // 监督员姓名
}

export const maintenanceTaskProcessList = (params?: MaintenanceTaskProcess | any) =>
  defHttp.get<MaintenanceTaskProcess>({ url: adminPath + '/maintenance/process/maintenanceTaskProcess/list', params });

export const maintenanceTaskProcessListData = (params?: MaintenanceTaskProcess | any) =>
  defHttp.post<Page<MaintenanceTaskProcess>>({ url: adminPath + '/maintenance/process/maintenanceTaskProcess/listData', params });

export const maintenanceTaskProcessForm = (params?: MaintenanceTaskProcess | any) =>
  defHttp.get<MaintenanceTaskProcess>({ url: adminPath + '/maintenance/process/maintenanceTaskProcess/form', params });

export const maintenanceTaskProcessSave = (params?: any, data?: MaintenanceTaskProcess | any) =>
  defHttp.postJson<MaintenanceTaskProcess>({ url: adminPath + '/maintenance/process/maintenanceTaskProcess/save', params, data });

export const maintenanceTaskProcessDelete = (params?: MaintenanceTaskProcess | any) =>
  defHttp.get<MaintenanceTaskProcess>({ url: adminPath + '/maintenance/process/maintenanceTaskProcess/delete', params });
